
//获取query参数
import {useSearchParams,useLocation} from "react-router-dom"
//获取location信息

function Page1Son1(){
    let [params,changeparams] = useSearchParams()
    let location = useLocation()
    console.log(location)
    return <>
        <button onClick={()=>{changeparams({
            id:"welcome",
            age:1111
        })}}> 更改query参数</button>
        <div>Page1----son1---获取query参数：{JSON.stringify(params.get("id"))} --- {JSON.stringify(params.get("age"))}</div>
    </>
}

export default Page1Son1